package com.wbw.ssb.controller;

import com.wbw.ssb.common.api.CommonResult;
import com.wbw.ssb.mbg.entity.Humidity;
import com.wbw.ssb.mbg.entity.Smog;
import com.wbw.ssb.service.HumidityService;
import com.wbw.ssb.service.TemperatureService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;

/**
 * @Author: guibo
 * @Description:
 * @Date: Created in 17:35 2021/5/25
 * @Modified By:
 */
@Api(tags = "湿度管理")
@RestController
@RequestMapping("/humidity")
public class HumidityController {
    @Autowired
    HumidityService humidityService;
    @ApiOperation("获取今天湿度")
    @GetMapping(value = "/getToday")
    CommonResult<LinkedHashMap<String,Double>> getToday(@RequestParam Long granaryNumber){
        return CommonResult.success(humidityService.getToday(granaryNumber));
    }
    @ApiOperation("获取当前湿度")
    @GetMapping(value = "/getNow")
    CommonResult<Humidity> getNow(@RequestParam Long granaryNumber){
        return CommonResult.success(humidityService.getNow(granaryNumber));
    }
}

